<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>上下拉刷新</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="../../../../assets/css/reset.css"/>

    <link rel="stylesheet" href="../../../../assets/css/examples.css"/>

</head>
<body>
<h1>
    上下拉刷新（Pull）
</h1>

<ul>
    <li>
        <a href="javascript:void(0)" id="pullDown">pullDown</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="closePullDown">closePullDown</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="pullUp">pullUp</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="closePullUp">closePullUp</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="scroll">添加滚动</a>
    </li>
</ul>
<!-- 5秒后自动隐藏 -->

<div style="height: 1000px;display: none;" id="scrollEl"></div>
<script  src="../../../../../core/$$.js"></script>
<script  src="../../../../../core/libs/zepto/zepto.min.js"></script>
<script  src="../../../../../core/libs/zepto/selector.js"></script>
<script  src="../../../../../core/libs/zepto/touch.js"></script>
<script  src="../../../../../core/libs/underscore-min.js"></script>
<script  src="../../../../../core/libs/oop.js"></script>
<script  src="../../../../../core/extend/prototype.js"></script>
<script  src="../../../../../core/extend/function.js"></script>
<script  src="../../../../../core/native/platformAdapter.js"></script>
<script  src="../../../../../core/native/api.js"></script>
<script  src="../../../../../core/native/eventListener.js"></script>
<script  src="../../../classes/XX.js"></script>
<script  src="../../../classes/common.js"></script>
<script  src="../../../../config/url/dev.js"></script>

<script type="text/javascript">

    $('#pullDown').on('tap', function () {
        $$.Native.pullDown({
            callback: function () {
                alert('触发回调（pullDown');
                setTimeout(function(){
                    $$.Native.hidePullDownAnim();
                },5000); 
            }
        });
    });    

    setTimeout(function(){
        $$.Native.hidePullDownAnim();
    },5000);  
    
    $('#closePullDown').on('tap', function () {
        $$.Native.closePullDown();
    });

    $('#pullUp').on('tap', function () {
        $$.Native.pullUp({
            callback: function () {
                alert('触发回调（pullUp）');
            }
        });
    });

    $('#closePullUp').on('tap', function () {
        $$.Native.closePullUp({
            callback : function(){
                $$.Native.tip("开启上拉刷新");
                setTimeout(function(){
                    $$.Native.hidePullUpAnim();
                },5000); 
            }
        });
    });

    $('#scroll').on('tap', function () {
        $('#scrollEl').show();
    });

</script>
</body>
</html>